from difflib import SequenceMatcher


def file_similarity_checker(f1, f2):
    with open(f1, errors='ignore') as file1, open(f2, errors='ignore') as file2:
        f1_data = file1.read()
        f2_data = file2.read()
        checking = SequenceMatcher(None, f1_data, f2_data).ratio()
        print(f"These files are {checking * 100} % similar")


file1 = 'test1.txt'
file2 = 'test2.txt'
file_similarity_checker(file1, file2)
